﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="wfAppraisalList.aspx.cs" Inherits="WSBulTasDesa.wfAppraisalList"
    EnableEventValidation="false" %>

<%@ Register Src="UserControls/ucFilter.ascx" TagName="ucFilter" TagPrefix="uc1" %>
<%@ Register Src="UserControls/ucDetails.ascx" TagName="ucDetails" TagPrefix="uc2" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Lista Tasaciones
    </h2>
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
    </asp:ScriptManager>
    <uc1:ucFilter ID="ucFilter" runat="server" />
    <asp:Button ID="btnSearch" runat="server" Text="Buscar" OnClick="btnSearch_Click" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <asp:GridView ID="grvAppraisal" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                OnRowCommand="grvAppraisal_RowCommand" EmptyDataText="No se encontraron resultados"
                AllowPaging="True" PageSize="12" OnPageIndexChanging="grvAppraisal_PageIndexChanging"
                OnSorting="grvAppraisal_Sorting" AllowSorting="True">
                <Columns>
                    <asp:TemplateField HeaderText="Fecha Carga" SortExpression="DateCreate">
                        <ItemTemplate>
                            <asp:Label ID="lblDateCreate" runat="server" Text='<%# Eval("DateCreate","{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="FolderNumber" HeaderText="Carpeta Nro." SortExpression="FolderNumber" />
                    <asp:BoundField DataField="EstablishmentName" HeaderText="Nombre Establecimiento"
                        SortExpression="EstablishmentName" />
                    <asp:TemplateField HeaderText="Provincia" SortExpression="ProvinceOrder">
                        <ItemTemplate>
                            <asp:Label ID="lblProvince" runat="server" Text='<%# Eval("Locality.Department.Province.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Departamento" SortExpression="DepartmentOrder">
                        <ItemTemplate>
                            <asp:Label ID="lblDepartment" runat="server" Text='<%# Eval("Locality.Department.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Localidad" SortExpression="LocalityOrder">
                        <ItemTemplate>
                            <asp:Label ID="lblLocality" runat="server" Text='<%# Eval("Locality.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Región" SortExpression="RegionOrder">
                        <ItemTemplate>
                            <asp:Label ID="lblRegion" runat="server" Text='<%# Eval("Zone.Region.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Zona" SortExpression="ZoneOrder">
                        <ItemTemplate>
                            <asp:Label ID="lblZone" runat="server" Text='<%# Eval("Zone.Name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Ha" HeaderText="Has." SortExpression="Ha" />
                    <asp:ButtonField ButtonType="Image" CommandName="View" ImageUrl="~/Img/view.PNG" />
                    <asp:ButtonField ButtonType="Image" CommandName="Edit" ImageUrl="~/Img/edit.PNG" />
                    <asp:ButtonField ButtonType="Image" CommandName="Land" ImageUrl="~/Img/peso.PNG" />
                    <asp:ButtonField ButtonType="Image" CommandName="Report" ImageUrl="~/Img/report.PNG" />
                </Columns>
                <PagerSettings Mode="NumericFirstLast" />
            </asp:GridView>
            <asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
            <asp:Panel ID="pnlDetails" runat="server" Style="display: none" Width="600px" Height="400px"
                BackColor="#CCFFCC">
                <div style="float: right;">
                    <asp:LinkButton ID="lnkClose" runat="server">Cerrar</asp:LinkButton>
                </div>
                <uc2:ucDetails ID="ucDetails" runat="server" />
            </asp:Panel>
            <ajaxToolkit:ModalPopupExtender ID="extDetails" runat="server" TargetControlID="btnShowPopup"
                PopupControlID="pnlDetails" DropShadow="true" CancelControlID="lnkClose" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
